home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18096 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.2 KB

  1. Path: scoop.eco.twg.com!usenet
  2. From: mike@vishnu.eco.twg.com (This space intentionally left blank)
  3. Newsgroups: comp.lang.c++,rec.games.programmer,alt.msdos.programmer,comp.programming
  4. Subject: Re: C style formatting (was Re: Young programmers read me.)
  5. Date: 18 Apr 1996 21:50:50 GMT
  6. Organization: The Wollongong Group
  7. Message-ID: <4l6dfq$kc@scoop.eco.twg.com>
  8. References: <4icpp9$7hr@barad-dur.nas.com> <4kvual$26t@butterfly.hjs.com>
  9. NNTP-Posting-Host: vishnu.eco.twg.com
  10.  
  11. In article <4kvual$26t@butterfly.hjs.com>, root@butterfly.hjs.com (John Flinchbaugh) writes:
  12. >> That way you can store the code in "crammed" format to save disk space, and
  13. >> convert it to your favorite style to work on it...and everyone can look at
  14. >> it in *their* preferred format and the arguments over where the braces go,
  15. >> or how many columns to use (80? 132? 547?) can disappear forever.
  16. >> 
  17. >> Anyone got such a program?  Writing it shouldn't be hard if you can define
  18. >> the style-definition-file format (user interfaces are always the hardest
  19. >> part :^).
  20. >
  21. >There's the 'indent' utility under unix.  The version on my linux box
  22. >is quit comprehensive, letting you define every little detail about
  23. >the style you might care to set.
  24.  
  25. Thanks, I'll look for it.  Maybe it's protable...
  26.  
  27. >Warning though, it DOESN'T work on C++ files!
  28.  
  29. Different syntax, so not surprising.  My guess is that the easiest way to
  30. write such a thing is to build the parse tree as if you were a compiler, and
  31. then "generate" C code as output from that tree, rather than object code. 
  32. Such a thing will be as language-specific as any compiler.
  33.  
  34.                 -- Mike "thanks for the pointer!" Bartman --
  35.  
  36. ==============================================================================
  37. | I didn't really say all the things that I said.  You probably didn't read  |
  38. | what you thought you read.  Statistics show that this whole thing is more  |
  39. | than likely just a hideous misunderstanding.                     |
  40. ==============================================================================
  41.  
  42. ==============================================================================
  43. Should I or shouldn't I?... Too late, I did!
  44. ------------------------------------------------------------------------------
  45.  
  46.